<%@page import="com.hotel.test.service.RomTypeLocalServiceUtil"%>
<%@page import="com.hotel.test.service.persistence.RomTypeUtil"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@include file="/html/init.jsp" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h3>Dat Phong khach san</h3>
<%

String hotelId = (String) request.getParameter("hotelId");
	String url = request.getParameter("url");
	
	
%>
<portlet:actionURL name="addBooking" var="addBookingURL">
	<portlet:param name="redirectTo" value="<%=url %>"></portlet:param>
	<portlet:param name="hotelId" value="<%=hotelId %>"></portlet:param>
</portlet:actionURL>

<form action="<%=addBookingURL%>" method="post">
	<fieldset>
	<legend>Thong tin Ve Ban</legend>
	<table>
		<tbody>
		<tr>
			<td>Ho Va Ten</td>
			<td> <input name="namePersonBooking" type="text"/> </td>
		</tr>
		
		<tr>
			<td>So Dien thoai</td>
			<td> <input name="numberPhone" type="text"/> </td>
		</tr>
		
		<tr>
			<td>Email</td>
			<td> <input name="email" type="text"/> </td>
		</tr>
		
		<tr>
			<td>Dia Chi</td>
			<td> <input name="address" type="text"/> </td>
		</tr>
		</tbody>
	</table>
	</fieldset>
	
	<fieldset>
	<legend>Thong Tin Dat Phong</legend>
	<table>
	<tbody>
	<tr>
		<td>So luong Khach</td>
		<td> <input type="number" name="numberOfGuest"/> </td>
	</tr>
	
	<tr>
		<td>Ngay Den </td>
		<td> <input type="text" name="dayStart"/> </td>
	</tr>
	
	<tr>
		<td>Ngay Di </td>
		<td> <input type="text" name="dayFinish"/> </td>
	</tr>
	
	<tr>
	<td>Kieu Phong</td>
		<td>
			<select name="roomId">
			<%
				List<RomType> rooms = RomTypeLocalServiceUtil.getByHotelId(Long.parseLong(hotelId));
				for(RomType r : rooms )
				{
					%>
						<option value="<%=r.getRomId()%>"><%=r.getRoomName() %></option>
					<%
				}
			%>
			</select>
		</td>
	</tr>
	
	<tr>
		<td> <input type="hidden" name="hotelId" value="<%=Long.parseLong(hotelId)%>"/> </td>
		<td> <input type="reset" /> </td>
		<td> <input type="submit" value="Dat Phong"/> </td>
	</tr>
	
	</tbody>
	</table>
	</fieldset>
</form>
</body>
</html>